/**
 * 普通用户 查看 个人信息
 */
var url = '';
var jsonData = '';
$(function() {
	var name = $("#input_name").val();
	initUserInfo(name);
});

function commonAjax(name){
	var result = '';
 	$.ajax({
		type : "GET",
		url: url,
	 	data : {managerUser_name:name},
	 	async: false,
		dataType : "json",
		success: function(data) {
				result = data;
			}
		});
 	//console.info("result = "+result);
 	return result;
}

function initUserInfo(name) {
	url =  ctx+'/userManage/showInfo';
	
	var dataObj = commonAjax(name);
	//console.info("dataObj = "+dataObj);
	//console.info("dataObj.user = "+dataObj.user);
	
	userInfoHtml(dataObj.user);
	
}

function userInfoHtml(data) {

	var returnHtml ='';
	
	
		   //输出 
			returnHtml += "<tr><td>"+data.userName+"</td>" +
			"<td>"+data.passwd+"</td>" +
			"<td>"+data.department+"</td>" +
			"<td>"+data.authority+"</td>" +
			"<td>"+data.state+"</td></tr>";
			//data-toggle='modal' data-target='#alterUser'
		    $('#userInfo').html(returnHtml);
		
	
	
}
